package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the CI_EVENTOS database table.
 * 
 */
@Embeddable
public class CiEventoPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private long entRefnum;
	private long secuencial;

    public CiEventoPK() {
    }

	@Column(name="ENT_REFNUM", unique=true, nullable=false)
	public long getEntRefnum() {
		return this.entRefnum;
	}
	public void setEntRefnum(long entRefnum) {
		this.entRefnum = entRefnum;
	}

	@Column(unique=true, nullable=false, precision=5)
	public long getSecuencial() {
		return this.secuencial;
	}
	public void setSecuencial(long secuencial) {
		this.secuencial = secuencial;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof CiEventoPK)) {
			return false;
		}
		CiEventoPK castOther = (CiEventoPK)other;
		return 
			(this.entRefnum == castOther.entRefnum)
			&& (this.secuencial == castOther.secuencial);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + ((int) (this.entRefnum ^ (this.entRefnum >>> 32)));
		hash = hash * prime + ((int) (this.secuencial ^ (this.secuencial >>> 32)));
		
		return hash;
    }
}